#include <stdio.h>
/**
 * 通过函数交换量数
 *
 *
 **/

void swap(int a,int b){
	int tmp = a;
	a = b;
	b = tmp;
	printf("swap a = %d,b=%d\n",a,b );
}

void swap1(int *a,int *b){
	int tmp = *a;
	*a = *b;
	*b = tmp;
	printf("swap a = %d,b=%d\n",*a,*b );
}


int main(int argc, char const *argv[])
{
	int a = 10;
	int b = 20;
	//swap(a,b);      //值传递,不管这个变量什么类型,只要是变量本身传递,就是值传递.
	
	swap1(&a,&b);
	printf("a = %d,b = %d\n", a,b);




	return 0;
}